package com.itcodai.utils.thread;

/**
 * 实现Runnable接口 更常用
 * @author c-fanqj
 * @date 2023/5/17
 * @apiNote
 */
/*public class CreateThreadRunnableTest implements Runnable {

    public static void main(String[] args) {
        Thread thread = new Thread(new CreateThreadRunnableTest());
        thread.start();
    }

    @Override
    public void run() {
        //super.run();
        System.out.println("hello jiejie");
    }

}*/

public class CreateThreadRunnableTest {

    public static void main(String[] args) {
       /* Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("hello jiejie");
            }
        });
        thread.start();*/

        // 简写
        Thread thread = new Thread(() -> System.out.println("hello runnable"));
        thread.start();
    }

}